﻿import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.0
import QtQuick.Controls 1.2
import paintline 1.0
Rectangle{
    width: 1280;
    height: 800;
    id:curve
    //color:"#E0E0E0";
    Rectangle{
        id:buttonarea;
        x:800;
        y:15;
        width:450;
        height:30;
        //color:"gray";
        ComboBox{
            height:30
            id:year;
            editable: false;
            model: [2014,2015,2016,2017,2018,2019,2020];
        }
        Text{
            x:year.x+57
            text:"年"
            anchors.verticalCenter: parent.verticalCenter;
            font.family: "Ubuntu";
            font.pixelSize: 15;
        }
        ComboBox{
            x:year.x+80;
            height:30
            id:month;
            editable: false;
            model:13
            currentIndex:1;
            validator: IntValidator {bottom: 1;top:12}

        }
        Text{
            x:month.x+57
            text:"月"
            anchors.verticalCenter: parent.verticalCenter;
            font.family: "Ubuntu";
            font.pixelSize: 15;
        }
        ComboBox{
            x:month.x+80;
            height:30
            id:day;
            editable: false;
            model: [1,2,3,4,5];
        }
        Text{
            x:day.x+57
            text:"日"
            anchors.verticalCenter: parent.verticalCenter;
            font.family: "Ubuntu";
            font.pixelSize: 15;
        }
//        Button{
//            id:selection;
//            x:72;
//            y:0;
//            text:"选 择";
//            style: btnStyle;
//        }
//        Button{
//            id:pagedn;
//            x:144;
//            y:0;
//            text:"下页 >";
//            style: btnStyle;
//        }
    }
    Rectangle{
        id:context;
        x:20;
        y:50;
        width:210;
        height:530;
        color:"#E0E0E0";
        border.width:1;
        border.color: "cadetblue";
        Text{
            text:"--查询内容...";
            x:5;y:7;
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 15;
        }
    }
    Rectangle{
        id:checkarea;
        x:20;
        y:582;
        width:210;
        height:130;
        border.width:1;
        border.color: "cadetblue";
        ScrollView{
            id:scroll;
            width:210;
            height:130;
            Column{
                x:10;
                y:4;
                spacing:3;
                CheckBox{
                    text:qsTr("烟尘浓度");
                    style:boxstyle
                }
                CheckBox{
                    id:so2check
                    checked:true;
                    text:qsTr("SO2");
                    style:boxstyle
                }
                CheckBox{
                    id:noxcheck
                    text:qsTr("NOx");
                    style:boxstyle
                }
                CheckBox{
                    id:o2check
                    text:qsTr("O2");
                    style:boxstyle
                }
                CheckBox{
                    text:qsTr("温度");
                    style:boxstyle
                }
                CheckBox{
                    id:cocheck
                    text:qsTr("CO");
                    style:boxstyle
                }
                CheckBox{
                    id:particulatescheck;
                    text:qsTr("颗粒物折算值");
                    style:boxstyle
                }
            }
        }
    }
    Rectangle{
        x:235;
        y:50;
        width:1030;
        height:40;
        color:"#E0E0E0";
        border.width: 1;
        border.color: "black";
        Rectangle{
            id:word;
            x:0;
            y:0;
            width:120;
            height:20;
            color:"#E0E0E0";
            border.width: 1;
            border.color: "black";
            Text{
                text:"时间";
                anchors.centerIn: parent;
                color: "black";
                font.family: "Ubuntu";
                font.pixelSize: 16;
            }
        }
        Rectangle{
            id:date;
            x:0;
            y:20;
            width:120;
            height:20;
            color:"#E0E0E0";
            border.width: 1;
            border.color: "black";
            Text{
                text:"2009-12-31 10:29:58";
                anchors.centerIn: parent;
                color: "black";
                font.family: "Ubuntu";
                font.pixelSize: 12;
            }
        }
    }
    Rectangle{
        id:display;
        x:235;
        y:92;
        width:1030;
        height:620;
        color:"#E0E0E0";
        border.width: 1;
        border.color: "gray";
        Text{
            x:30;
            y:10;
            text:"100.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35
            y:68
            text:"90.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35
            y:126
            text:"80.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35
            y:184
            text:"70.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:240;
            text:"60.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:298;
            text:"50.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:356;
            text:"40.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:414;
            text:"30.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:472;
            text:"20.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:35;y:530;
            text:"10.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }
        Text{
            x:40;y:588;
            text:"0.00-";
            color: "black";
            font.family: "Ubuntu";
            font.pixelSize: 13;
        }

        Rectangle{
            id:drawwindow;
            x:80;
            y:15;
            width:932;
            height:580;
            color:"black";
            Draw{
                id:draw
                anchors.fill: parent
                Component.onCompleted: {
                    co(cocheck.checked);
                    nox(noxcheck.checked);
                    o2(o2check.checked);
                    particulates(particulatescheck.checked);
                    so2(so2check.checked);
                    setTimeRange(7);
                    //console.log("Dd");
                    setStartTime("2017-12-12 19:22");
                    setWindowWidth(drawwindow.width);
                    setWindowHeight(drawwindow.height);
                    setMaxValue(100);
                }
            }
        }
        Rectangle{
            x:80;
            y:600;
            width:120;
            height:13;
            color:"#E0E0E0";
            Text{
                text:"2009-12-31 10:00";
                color: "black";
                font.family: "Ubuntu";
                font.pixelSize: 13;
            }
        }
    }
    Component{
        id: btnStyle;
        ButtonStyle{
            background: Rectangle{
                implicitWidth: 70;
                implicitHeight: 30;
                border.width: 1;
                border.color: "black";
                radius: 3;
            }
        }
    }
    Component{
        id:boxstyle
        CheckBoxStyle {
            indicator: Rectangle {
                width: 15
                height: 15
                border.color: control.activeFocus ? "darkblue" : "gray"
                border.width: 1
                Rectangle {
                    visible: control.checked
                    color: "#555"
                    border.color: "#333"
                    radius: 1
                    anchors.margins: 3
                    anchors.fill: parent
                }
            }
        }
    }
}

